package com;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class TestSubList {
	public static void main(String[] args) {
		List<String> list = new ArrayList<String>();
		for (int i = 1; i <= 30; i++) {
			list.add(i + "");
		}
		
		 int segmentSize = 100;
	        List<List<String>> segmentedLists = list.stream()
	              .collect(Collectors.groupingBy(it -> list.indexOf(it) / segmentSize))
	              .values().stream().map(group -> group.stream().collect(Collectors.toList()))
	              .collect(Collectors.toList());
	        
	        for(List<String> l : segmentedLists) {
	        	System.out.println(l);
	        }
		
		
	}
}
